const DEFAULT_FILTERS = {
  username: '',
  description:'',
  startDate:'',
  endDate:''
}
export default {
  namespaced: true,
  state: {
    name: 'visitLogs',
    filters: DEFAULT_FILTERS
  },
  getters: {
    getName(state) {
      return state.name
    },
    getFilters(state) {
      return state.filters
    }
  },
  mutations: {
    setFilters(state, filters) {
      state.filters = filters
    },
    resetFilters(state) {
      state.filters = {
        username: '',
        description:'',
        startDate:'',
        endDate:''
      }
    }
  },
  actions: {
    setFilters({ commit }, filters) {
      commit('setFilters', filters)
    },
    resetFilters({ commit }) {
      commit('resetFilters')
    }
  }
}
